package com.code.base.log.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.log.persistence.LogSpUpdMapper;
import com.code.base.log.pojo.LogSpUpd;
import com.code.util.PrimaryKeyUtil;


@Service
public class LogSpUpdService {


	@Resource
	private LogSpUpdMapper logSpUpdMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public LogSpUpd getDataById(Long id) {
		return logSpUpdMapper.getDataById(id);
	}

	public List<LogSpUpd> getAllData() {
		return logSpUpdMapper.getAllData();
	}

	public int getDataCountByCondition(LogSpUpd entity) {
		return logSpUpdMapper.getDataCountByCondition(entity);
	}

	public List<LogSpUpd> getDataByCondition(LogSpUpd entity) {
		return logSpUpdMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(LogSpUpd entity) {
		return logSpUpdMapper.getDataCountByLikeCondition(entity);
	}

	public List<LogSpUpd> getDataByLikeCondition(LogSpUpd entity) {
		return logSpUpdMapper.getDataByLikeCondition(entity);
	}

	public List<LogSpUpd> getDataByIds(Long[] ids) {
		return logSpUpdMapper.getDataByIds(ids);
	}

	public void insertData(LogSpUpd entity) {
		insertData(entity, true);
	}

	public void insertData(LogSpUpd entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		logSpUpdMapper.insertData(entity);
	}

	public void updateData(LogSpUpd entity) {
		logSpUpdMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		logSpUpdMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(LogSpUpd entity) {
		logSpUpdMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		logSpUpdMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		logSpUpdMapper.deleteDataByIds(ids);
	}

}
